package mvcweb.servlet.support;

import mvcweb.config.DispatcherServletConfiguration;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

/**
 * spring mvc 自动装配的实现
 * @Author acy
 * @Date 2019/04/29
 */
public class DefaultAnnotationConfigDispatcherServletInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
	//对应web.xml
	@Override
	protected Class<?>[] getRootConfigClasses() {
		return new Class[0];
	}

	//对应DispatchServlet   <servlet>
	@Override
	protected Class<?>[] getServletConfigClasses() {
		return new Class[]{DispatcherServletConfiguration.class};
	}

	//对应servlet的映射  <servlet-mapping>
	@Override
	protected String[] getServletMappings() {
		return new String[]{"/"};
	}
}
